home *** CD-ROM | disk | FTP | other *** search
/ Champak 141 / (Vol 141) Oct 17 2011.iso / Games / flight-of-the-museum.swf / scripts / engine / levelData / Level_08.as < prev    next >
Encoding:
Text File  |  2011-10-17  |  10.0 KB  |  290 lines

  1. package engine.levelData
  2. {
  3.    import copy.CopyBank;
  4.    import engine.WorldScene;
  5.    import engine.dynamicObjects.*;
  6.    
  7.    public class Level_08 extends LevelData
  8.    {
  9.        
  10.       
  11.       public function Level_08()
  12.       {
  13.          super();
  14.          _goalParameters = new Array();
  15.       }
  16.       
  17.       override public function buildLevel() : *
  18.       {
  19.          var i:* = undefined;
  20.          var rNum:* = undefined;
  21.          var podium:* = undefined;
  22.          var cage:* = undefined;
  23.          var px:Number = NaN;
  24.          var indian:* = undefined;
  25.          var fuelIcon:* = undefined;
  26.          var goalObj:Object = null;
  27.          var missionObj:Object = null;
  28.          super.buildLevel();
  29.          rNum = Math.random();
  30.          for(i = 0; i < 5; i++)
  31.          {
  32.             rNum = Math.random();
  33.             px = 150 + Math.random() * 75 + i * 160;
  34.             if(rNum < 0.3)
  35.             {
  36.                podium = new Podium("tall");
  37.                podium.x = px;
  38.                podium.y = 700;
  39.                WorldScene.Instance.GameplayObjects.push(podium);
  40.                cage = new Cage1();
  41.                cage.x = podium.x - 16;
  42.                cage.y = 568;
  43.                WorldScene.Instance.GameplayObjects.push(cage);
  44.                WorldScene.Instance.Cages.push(cage);
  45.                if(i > 0)
  46.                {
  47.                   indian = new Indian();
  48.                   indian.x = podium.x + 16;
  49.                   if(i > 2)
  50.                   {
  51.                      indian.LobMode = true;
  52.                   }
  53.                   indian.y = -8 + 568;
  54.                   WorldScene.Instance.GameplayObjects.push(indian);
  55.                   WorldScene.Instance.Indians.push(indian);
  56.                }
  57.             }
  58.             if(rNum >= 0.3 && rNum < 0.6)
  59.             {
  60.                podium = new Podium("med");
  61.                podium.x = px;
  62.                podium.y = 700;
  63.                WorldScene.Instance.GameplayObjects.push(podium);
  64.                cage = new Cage1();
  65.                cage.x = podium.x - 16;
  66.                cage.y = 582;
  67.                WorldScene.Instance.GameplayObjects.push(cage);
  68.                WorldScene.Instance.Cages.push(cage);
  69.                if(i > 0)
  70.                {
  71.                   indian = new Indian();
  72.                   indian.x = podium.x + 16;
  73.                   if(i > 2)
  74.                   {
  75.                      indian.LobMode = true;
  76.                   }
  77.                   indian.y = -8 + 582;
  78.                   WorldScene.Instance.GameplayObjects.push(indian);
  79.                   WorldScene.Instance.Indians.push(indian);
  80.                }
  81.             }
  82.             if(rNum >= 0.6)
  83.             {
  84.                podium = new Podium("short");
  85.                podium.x = px;
  86.                podium.y = 700;
  87.                WorldScene.Instance.GameplayObjects.push(podium);
  88.                cage = new Cage1();
  89.                cage.x = podium.x - 16;
  90.                cage.y = 604;
  91.                WorldScene.Instance.GameplayObjects.push(cage);
  92.                WorldScene.Instance.Cages.push(cage);
  93.                if(i > 0)
  94.                {
  95.                   indian = new Indian();
  96.                   indian.x = podium.x + 16;
  97.                   if(i > 2)
  98.                   {
  99.                      indian.LobMode = true;
  100.                   }
  101.                   indian.y = -8 + 604;
  102.                   WorldScene.Instance.GameplayObjects.push(indian);
  103.                   WorldScene.Instance.Indians.push(indian);
  104.                }
  105.             }
  106.          }
  107.          for(i = 0; i < 5; i++)
  108.          {
  109.             rNum = Math.random();
  110.             px = 1200 + Math.random() * 75 + i * 160;
  111.             if(rNum < 0.3)
  112.             {
  113.                podium = new Podium("tall");
  114.                podium.x = px;
  115.                podium.y = 700;
  116.                WorldScene.Instance.GameplayObjects.push(podium);
  117.                cage = new Cage1();
  118.                cage.x = podium.x - 16;
  119.                cage.y = 568;
  120.                WorldScene.Instance.GameplayObjects.push(cage);
  121.                WorldScene.Instance.Cages.push(cage);
  122.                if(i > 0)
  123.                {
  124.                   indian = new Indian();
  125.                   indian.x = podium.x + 16;
  126.                   if(i > 2)
  127.                   {
  128.                      indian.LobMode = true;
  129.                   }
  130.                   indian.y = -8 + 568;
  131.                   WorldScene.Instance.GameplayObjects.push(indian);
  132.                   WorldScene.Instance.Indians.push(indian);
  133.                }
  134.             }
  135.             if(rNum >= 0.3 && rNum < 0.6)
  136.             {
  137.                podium = new Podium("med");
  138.                podium.x = px;
  139.                podium.y = 700;
  140.                WorldScene.Instance.GameplayObjects.push(podium);
  141.                cage = new Cage1();
  142.                cage.x = podium.x - 16;
  143.                cage.y = 582;
  144.                WorldScene.Instance.GameplayObjects.push(cage);
  145.                WorldScene.Instance.Cages.push(cage);
  146.                if(i > 0)
  147.                {
  148.                   indian = new Indian();
  149.                   indian.x = podium.x + 16;
  150.                   if(i > 2)
  151.                   {
  152.                      indian.LobMode = true;
  153.                   }
  154.                   indian.y = -8 + 582;
  155.                   WorldScene.Instance.GameplayObjects.push(indian);
  156.                   WorldScene.Instance.Indians.push(indian);
  157.                }
  158.             }
  159.             if(rNum >= 0.6)
  160.             {
  161.                podium = new Podium("short");
  162.                podium.x = px;
  163.                podium.y = 700;
  164.                WorldScene.Instance.GameplayObjects.push(podium);
  165.                cage = new Cage1();
  166.                cage.x = podium.x - 16;
  167.                cage.y = 604;
  168.                WorldScene.Instance.GameplayObjects.push(cage);
  169.                WorldScene.Instance.Cages.push(cage);
  170.                if(i > 0)
  171.                {
  172.                   indian = new Indian();
  173.                   indian.x = podium.x + 16;
  174.                   if(i > 2)
  175.                   {
  176.                      indian.LobMode = true;
  177.                   }
  178.                   indian.y = -8 + 604;
  179.                   WorldScene.Instance.GameplayObjects.push(indian);
  180.                   WorldScene.Instance.Indians.push(indian);
  181.                }
  182.             }
  183.          }
  184.          for(i = 0; i < 5; i++)
  185.          {
  186.             rNum = Math.random();
  187.             px = 2300 + Math.random() * 75 + i * 160;
  188.             if(rNum < 0.3)
  189.             {
  190.                podium = new Podium("tall");
  191.                podium.x = px;
  192.                podium.y = 700;
  193.                WorldScene.Instance.GameplayObjects.push(podium);
  194.                cage = new Cage1();
  195.                cage.x = podium.x - 16;
  196.                cage.y = 568;
  197.                WorldScene.Instance.GameplayObjects.push(cage);
  198.                WorldScene.Instance.Cages.push(cage);
  199.                if(i > 0)
  200.                {
  201.                   indian = new Indian();
  202.                   indian.x = podium.x + 16;
  203.                   if(i > 2)
  204.                   {
  205.                      indian.LobMode = true;
  206.                   }
  207.                   indian.y = -8 + 568;
  208.                   WorldScene.Instance.GameplayObjects.push(indian);
  209.                   WorldScene.Instance.Indians.push(indian);
  210.                }
  211.             }
  212.             if(rNum >= 0.3 && rNum < 0.6)
  213.             {
  214.                podium = new Podium("med");
  215.                podium.x = px;
  216.                podium.y = 700;
  217.                WorldScene.Instance.GameplayObjects.push(podium);
  218.                cage = new Cage1();
  219.                cage.x = podium.x - 16;
  220.                cage.y = 582;
  221.                WorldScene.Instance.GameplayObjects.push(cage);
  222.                WorldScene.Instance.Cages.push(cage);
  223.                if(i > 0)
  224.                {
  225.                   indian = new Indian();
  226.                   indian.x = podium.x + 16;
  227.                   if(i > 2)
  228.                   {
  229.                      indian.LobMode = true;
  230.                   }
  231.                   indian.y = -8 + 582;
  232.                   WorldScene.Instance.GameplayObjects.push(indian);
  233.                   WorldScene.Instance.Indians.push(indian);
  234.                }
  235.             }
  236.             if(rNum >= 0.6)
  237.             {
  238.                podium = new Podium("short");
  239.                podium.x = px;
  240.                podium.y = 700;
  241.                WorldScene.Instance.GameplayObjects.push(podium);
  242.                cage = new Cage1();
  243.                cage.x = podium.x - 16;
  244.                cage.y = 604;
  245.                WorldScene.Instance.GameplayObjects.push(cage);
  246.                WorldScene.Instance.Cages.push(cage);
  247.                if(i > 0)
  248.                {
  249.                   indian = new Indian();
  250.                   indian.x = podium.x + 16;
  251.                   if(i > 2)
  252.                   {
  253.                      indian.LobMode = true;
  254.                   }
  255.                   indian.y = -8 + 604;
  256.                   WorldScene.Instance.GameplayObjects.push(indian);
  257.                   WorldScene.Instance.Indians.push(indian);
  258.                }
  259.             }
  260.          }
  261.          fuelIcon = new FuelIcon();
  262.          fuelIcon.x = 4000;
  263.          fuelIcon.y = 2000;
  264.          WorldScene.Instance.GameplayObjects.push(fuelIcon);
  265.          fuelIcon = new FuelIcon();
  266.          fuelIcon.x = 5000;
  267.          fuelIcon.y = 2000;
  268.          WorldScene.Instance.GameplayObjects.push(fuelIcon);
  269.          _missionDescription = CopyBank.Instance.MissionDesc_Cages;
  270.          goalObj = {
  271.             "Type":"Cage",
  272.             "Count":15
  273.          };
  274.          _goalParameters.push(goalObj);
  275.          missionObj = {
  276.             "Description":_missionDescription,
  277.             "BoundsX":_missionBoundsX,
  278.             "BoundsHint":_missionBoundsHint,
  279.             "GoalParamaters":_goalParameters,
  280.             "PrimaryGoalType":"Cages",
  281.             "StartLoc":{
  282.                "x":400,
  283.                "y":400
  284.             }
  285.          };
  286.          WorldScene.Instance.setMissionDetails(missionObj);
  287.       }
  288.    }
  289. }
  290.